/**
 * 受理案件, 受理中心
 */

import axios from "@/utils/axios";

// 新增
export const add = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/add",
    method: "POST",
    data,
  });
// 地区
export const area = (params) =>
  axios({
    url: "/api/v1/workOrder/distribute/area",
    method: "GET",
    params,
  });
// 案件受理(待受理案件)
export const receive = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/receive",
    method: "POST",
    data,
  });
// 取消受理(针对调查中的案件)
export const cancelDistribute = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/canceldistribute",
    method: "POST",
    data,
  });
// 取消办结案件(针对已办结的案件)
export const cancelfinish = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/cancelfinish",
    method: "POST",
    data,
  });
// 取消不受理（针对不受理的案件）
export const cancelReject = (workOrderNo) =>
  axios({
    url: `/api/v1/workOrder/distribute/cancelreject/${workOrderNo}`,
    method: "POST",
  });
// 详情
export const detail = (id) =>
  axios({
    url: `/api/v1/workOrder/distribute/detail/${id}`,
    method: "GET",
  });

// 列表
export const list = (params) =>
  axios({
    url: "/api/v1/workOrder/distribute/list",
    method: "GET",
    params,
  });
// 编辑
export const modify = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/modify",
    method: "POST",
    data,
  });
// 流程详情
export const process = (id) =>
  axios({
    url: `/api/v1/workOrder/distribute/process/${id}`,
    method: "GET",
  });
// 不受理（针对待受理、回退中的案件）
export const reject = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/reject",
    method: "POST",
    data,
  });

// 获取受理交办的部门树
export const transferDepartmentTree = (params) =>
  axios({
    url: "/api/v1/workOrder/distribute/transfer/department/tree",
    method: "GET",
    params,
  });

// 获取受理交办的部门树
export const distributeDepartmentTree = (params) =>
  axios({
    url: "/api/v1/workOrder/distribute/distribute/department/tree",
    method: "GET",
    params,
  });

// 受理交办(针对待受理、回退中的案件)
export const distribute = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/distribute",
    method: "POST",
    data,
  });

export const acceptance = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/acceptance",
    method: "POST",
    data,
  });

// 转移交办(回退中的案件)
export const distributeTransfer = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/distributeTransfer",
    method: "POST",
    data,
  });

// 移交(针对待受理的案件)
export const transfer = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/transferDepartment",
    method: "POST",
    data,
  });

// 流程详情
export const processDetails = (id) =>
  axios({
    url: `/api/v1/workOrder/distribute/process/${id}`,
    method: "GET",
  });

// 办结案件(针对已处理的案件)
export const finish = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/finish",
    method: "POST",
    data,
  });
// 修改结案状态(针对已办结的案件)
export const modifyFinishStatus = (data) =>
  axios({
    url: "/api/v1/workOrder/finish/modifyFinishStatus",
    method: "POST",
    data,
  });
// 取消办结案件(针对已办结的案件)
export const cancelFinish = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/cancelfinish",
    method: "POST",
    data,
  });

// 退回案件(针对已处理的案件)
export const back = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/back",
    method: "POST",
    data,
  });

// 中止案件(针对处理中的案件)
export const stop = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/stop",
    method: "POST",
    data,
  });
// 延期案件(针对处理中的案件)
export const addtime = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/addtime",
    method: "POST",
    data,
  });

// 上传补正材料
export const addAttachment = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/addattachment",
    method: "POST",
    data,
  });

// 【发起举报】-暂存举报详情
export const getTemporaryStorage = (params) =>
  axios({
    url: "/api/v1/workOrder/distribute/getTemporaryStorage",
    method: "GET",
    params,
  });

// 【发起举报】-暂存举报
export const temporaryStorage = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/temporaryStorage",
    method: "POST",
    data,
  });

// 发起补正材料
export const updateMaterial = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/updatematerial",
    method: "POST",
    data,
  });

// 撤回补正材料
export const revoke = (params) =>
  axios({
    url: "/api/v1/workOrder/distribute/revoke",
    method: "POST",
    params,
  });

export const recallApprove = (params) =>
  axios({
    url: "/api/v1/workOrder/distribute/approve",
    method: "POST",
    params,
  });

export const makeACopyFor = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/makeACopyFor",
    method: "POST",
    data,
  });

export const queryMakeACopyFor = (params) =>
  axios({
    url: "/api/v1/workOrder/distribute/queryMakeACopyFor",
    method: "GET",
    params,
  });

// 获取允许复核、允许退回的针对本案件的权限信息
export const getWorkOrderPermission = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/getWorkOrderPermission",
    method: "POST",
    data,
  });

// 保存允许复核、允许退回的针对本案件的权限信息
export const saveWorkOrderPermission = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/saveWorkOrderPermission",
    method: "POST",
    data,
  });
